home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2003 June / macformat-130.iso / mac / Reviewed⁄Demos / Spearhead Demo / demota / pak1.pk3 / anim / walk.scr < prev   
Encoding:
Text File  |  2002-10-21  |  3.5 KB  |  130 lines

  1. //------
  2. // Walk
  3. //------
  4. // Walk.  Simple.  This is the standing walk, so if the character is not standing up 
  5. // then this script will delegate to the stand script first.
  6. // TODO: Need to set upper body animations too!
  7.  
  8. //println "Entering walk.scr"
  9. //println "Called walk.scr with mood " self.mood
  10.  
  11.  
  12. //=================================================
  13. //=================================================
  14. start:
  15.  
  16.     waitexec anim/default_inithandler.scr
  17.     waitexec anim/smoking.scr::SmokeRemoveCigarette
  18.  
  19.     //make sure we are standing...
  20.     waitexec anim/stand.scr::transition
  21.  
  22.     self.position = walk
  23.     
  24.     while (1)
  25.     {
  26.         self.blendtime = 0.30
  27.  
  28.         switch (self.weapongroup)
  29.         {
  30.             pistol:
  31.             rifle:
  32.             mp40:
  33.             mp44:
  34.             bar:
  35.             thompson:
  36.             unarmed:
  37.             bazooka:
  38.                 if (self.ground == water)
  39.                 {
  40.                     self setmotionanim (walk_rifle_water)
  41.                     self waittill flaggedanimdone
  42.                 }
  43.                 else
  44.                 {
  45.                     switch (self.mood)
  46.                     {
  47.                         case curious:
  48.                             if (self.weapongroup == bazooka)
  49.                             {
  50.                                 //self setmotionanim (self.weapongroup + "_walk_alert_forward")
  51.                                 waitexec anim/walk.scr::WalkPlayMotionBlendAnim (self.weapongroup + "_walk_alert_")
  52.                             }
  53.                             else
  54.                             {
  55.                                 //self setmotionanim (self.weapongroup + "_walk_curious_forward")
  56.                                 waitexec anim/walk.scr::WalkPlayMotionBlendAnim (self.weapongroup + "_walk_curious_")
  57.                             }
  58.                             break
  59.                         case alert:
  60.                             if (self.normal_health < 40)
  61.                             {
  62.                                 //self setmotionanim (walk_injured)
  63.                                 waitexec anim/walk.scr::WalkPlayMotionBlendAnim "walk_injured_"
  64.                             }
  65.                             else
  66.                             {
  67.                                 //self setmotionanim (self.weapongroup + "_walk_alert_forward")
  68.                                 waitexec anim/walk.scr::WalkPlayMotionBlendAnim (self.weapongroup + "_walk_alert_")
  69.                             }
  70.                             break
  71.                         case nervous:
  72.                             if (self.normal_health < 40)
  73.                             {
  74.                                 //self setmotionanim (walk_injured)
  75.                                 waitexec anim/walk.scr::WalkPlayMotionBlendAnim "walk_injured_"
  76.                             }
  77.                             else
  78.                             {
  79.                                 //self setmotionanim (self.weapongroup + "_walk_forward")
  80.                                 waitexec anim/walk.scr::WalkPlayMotionBlendAnim (self.weapongroup + "_walk_")
  81.                             }
  82.                             break
  83.                         case bored:
  84.                             //self setmotionanim (self.weapongroup + "_walk_forward")
  85.                             waitexec anim/walk.scr::WalkPlayMotionBlendAnim (self.weapongroup + "_walk_")
  86.                             break
  87.                         default:
  88.                             //println "Stand default case for mood " self.mood
  89.                             if (self.normal_health < 40)
  90.                             {
  91.                                 //self setmotionanim (walk_injured)
  92.                                 waitexec anim/walk.scr::WalkPlayMotionBlendAnim "walk_injured_"
  93.                             }
  94.                             else
  95.                             {
  96.                                 //self setmotionanim (self.weapongroup + "_walk_forward")
  97.                                 waitexec anim/walk.scr::WalkPlayMotionBlendAnim (self.weapongroup + "_walk_")
  98.                             }
  99.                             break
  100.                     }
  101.                 }
  102.                 break
  103.                 
  104.             default:
  105.                 println "Walk default case for " self.weapongroup " weapongroup - fix walk.scr"
  106.                 self setmotionanim rifle_walk_forward
  107.                 self waittill flaggedanimdone
  108.                 break
  109.         }
  110.     }
  111.  
  112. end
  113.  
  114.  
  115. //=================================================
  116. //=================================================
  117. WalkPlayMotionBlendAnim local.animbasenme:
  118.     if (self.movedir != (0 0 0))
  119.     {
  120.         //println "Walk.scr using motion blend with movedir: " self.movedir
  121.         waitexec anim/motionblend.scr::PlayAnim local.animbasenme
  122.     }
  123.     else
  124.     {
  125.         //println "Walk.scr with **NO** motion blend"
  126.         self setmotionanim (local.animbasenme + "forward")
  127.         self waittill flaggedanimdone
  128.     }
  129. end
  130.